package pww.utils;

import dbUtil.SQLExecute;

public class SQlExcuteFactory {
    private static ThreadLocal<SQLExecute> local=new ThreadLocal<>();
    private SQlExcuteFactory(){

    }
    public static SQLExecute openSqlExcute(){
        return new SQLExecute(ConnUtil.getConnection());
    }

    public static SQLExecute currentSqlExcute(){
        if (local.get()==null){
            local.set(new SQLExecute(ConnUtil.getConnection()));
        }
        return local.get();
    }

    public static void remove(){
        local.remove();
    }
}
